package com.lanou.mapper;

import com.lanou.bean.Cost;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CostMapper {
    int deleteByPrimaryKey(Integer costId);

    int insert(Cost record);

    int insertSelective(Cost record);

    //    修改的时候数据回显
    Cost selectByPrimaryKey(Integer cost_id);


    int updateByPrimaryKeySelective(Cost record);

    int updateByPrimaryKey(Cost record);

    List<Cost> selectAllCostInfo();

//    添加数据
    int insertCost(@Param("name") String name, @Param("base_duration") String base_duration, @Param("base_cost") String base_cost, @Param("unit_cost") String unit_cost, @Param("descr") String descr);

//    删除数据
    int deleteCostById(Integer cost_id);

    int deleteserviceById(Integer cost_id);

    List<Cost> selectAllCostAndSort();


    List<Cost> selectAllCostAndSortByCost();


//    保存的时候执行updatecost
    int updateCost(@Param("cost_id")Integer cost_id,@Param("name") String name, @Param("base_duration") String base_duration, @Param("base_cost") String base_cost, @Param("unit_cost") String unit_cost, @Param("descr") String descr);


//    开通服务，更新状态
    int updateCostStatus(@Param("cost_id")Integer cost_id,@Param("status")Integer status,@Param("startime")String startime);

//    资费名称详情
    Cost selectCostByName(Integer cost_id);
}